package cn.hnu.qq.client.controller;

import java.util.ArrayList;

import cn.hnu.qq.entity.Crowd;
import cn.hnu.qq.entity.User;
import cn.hnu.qq.global.Email;
import cn.hnu.qq.global.SimpleMailSender;

public class SendEmailController extends CenterController {
	
	public static SendEmailController instance = null;
	
	private SendEmailController(){}
	
	public synchronized static SendEmailController getInstance(){
		if(instance == null){
			instance = new SendEmailController();
		}
		return instance;
	}

	public void sendEmail(ArrayList<String> receriver, Email email) throws Exception{
		SimpleMailSender sms = new SimpleMailSender(email.account, email.password);
		sms.send(receriver, email);
	}
	
}
